package parameterized_type;

import java.util.ArrayList;

public class ListSample {
    public static void main(String[] args) {
        sample1();
    }

    public static void sample1() {
        ArrayList bookList = new ArrayList();
        bookList.add("sz");
        bookList.add("dsa");
        bookList.add("as");
        bookList.add("qq");
        Object o1 = bookList.get(0);
        String bookName1 = (String) o1;
        System.out.println(bookName1);
    }

    public static void sample2() {
        ArrayList<String> bookList = new ArrayList<>();
        bookList.add("sgyy");
        bookList.add("shz");
        // bookList.add(123456);
        System.out.println(bookList.get(0));


    }
}

